<?php
$this->title = "A-PMS资产管理系统-申请立项";
$this->registerCssFile('/css/index.css');
$this->registerCssFile('/css/notEdit.css');
$this->registerCssFile('/css/AssetPackageDetails.css');
$this->registerCssFile('/css/mask.css');

$this->registerJsFile('/js/index.js');
$this->registerJsFile('/js/AssetPackageDetails.js');

?>





                        <!-- Modal -->
                          <div class="modal-dialog" role="document">
                            <div class="modal-content">
                              <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                 <div class="pull-left modal-nav">
                                    <img src="/image/assetPackage/white.png" class="pull-left">
                                    <span class="pull-left">申请立项</span>
                                </div>
                              </div>
                              <div class="modal-body-approval">
                                <p>1.立项报告完成情况</p>
                                <div class="modal-body-approval-div">
                                    <div class="form-group">
                                        <label for="" class="pull-left select-label"> 资产包基本情况</label>
                                        <?php if ($BasePackage['code']==200){?>
                                            <img src="/image/assetPackage/sucess.png" class="pull-left">
                                        <?php }else{ ?>
                                            <img src="/image/assetPackage/warning.png" class="pull-left">
                                            <span class="pull-left"><?= $BasePackage['message']?></span>
                                        <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 流转、前期处置及维护情况</label>
                                         <?php if ($PackageTransferHistory['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageTransferHistory['message']?></span>
                                         <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 卖家提供的信息资料</label>
                                         <?php if ($PackageInitiation_seller_files['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageInitiation_seller_files['message']?></span>
                                         <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 资产成交的期限和成交方式</label>
                                         <?php if ($PackageInitiation_deal_method['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageInitiation_deal_method['message']?></span>
                                         <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 当地共同处置资产包的合作伙伴情况</label>
                                         <?php if ($PackageInitiation_partners['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageInitiation_partners['message']?></span>
                                         <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 当地司法环境对所立项目的法律支持分析</label>
                                         <?php if ($PackageInitiation_law['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageInitiation_law['message']?></span>
                                         <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 卖家报价、及未来价格可谈判空间</label>
                                         <?php if ($PackageInitiation_bargain['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageInitiation_bargain['message']?></span>
                                         <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 团队组成</label>
                                         <?php if ($PackageInitiation_team['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?=$PackageInitiation_team['message']?></span>
                                         <?php } ?>
                                    </div>
                                        <label for="" class="pull-left select-label"> 工作计划</label>
                                         <div class="form-group">
                                             <?php if ($PackageInitiationPlan['code']==200){?>
                                                 <img src="/image/assetPackage/sucess.png" class="pull-left">
                                             <?php }else{ ?>
                                                 <img src="/image/assetPackage/warning.png" class="pull-left">
                                                 <span class="pull-left"><?=$PackageInitiationPlan['message']?></span>
                                             <?php } ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left select-label"> 团队收益分配</label>
                                         <?php if ($PackageInitiationIncome['code']==200){?>
                                             <img src="/image/assetPackage/sucess.png" class="pull-left">
                                         <?php }else{ ?>
                                             <img src="/image/assetPackage/warning.png" class="pull-left">
                                             <span class="pull-left"><?= $PackageInitiationIncome['message'] ?></span>
                                         <?php } ?>
                                    </div>

                                </div>
                              </div>
                              <div class="modal-body-approval">
                                <p>2.预评估表完成情况</p>

                                <div class="modal-body-approval-div">
                                    <div class="form-group">
                                        <label for="" class="pull-left  c999 fon" > 预评估亮点项目</label>
                                        <span class="c333">混合类<?= $yupinggucount['Hunhe']?>个</span>
                                        <span class="c333">抵押类<?= $yupinggucount['Diya']?>个</span>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left  c999 fon" > 折扣率</label><?= $zkl ?>
                                    </div>
                                     <div class="form-group">
                                        <label for="" class="pull-left  c999 fon" > 预估投资回报率</label><?= $evaluationHBB ?>
                                    </div>
                                </div>
                              </div>
                              <div class="modal-body-approval">
                                <p>3. 申请立项理由</p>
                                <div class="modal-body-approval-div">
                                        <textarea class="textarea-edit" style="border:none;height: auto;width: 100%;" placeholder="请简要描述申请立项的理由" id="reason"><?= $reasonData;?></textarea>
                                </div>
                              </div>
                              <div class="modal-footer">
                                <button type="button" class="btn btn-default btns-primary" data-dismiss="modal">取消</button>
                                <?php
                                    if ($BasePackage['code']==200 && $PackageTransferHistory['code']==200 && $PackageInitiation_seller_files['code']==200 && $PackageInitiation_deal_method['code']==200 && $PackageInitiation_partners['code']==200 && $PackageInitiation_law['code']==200 && $PackageInitiation_bargain['code']==200 && $PackageInitiation_team['code']==200 && $PackageInitiationPlan['code']==200 && $PackageInitiationIncome['code']==200){
                                        ?>
                                        <button type="button" class="btn btn-primary btns-primary"  id="button">提交</button>
<?php
                                    }else{
                                        ?>
                                        <button type="button" class="btn btn-primary btns-primary"  id="button">提交</button>
<!--                                        <button type="button" disabled="disabled" class="btn btn-primary btns-primary" id="button">提交</button>-->
                                        <?php
                                    }
                                ?>
                              </div>
                            </div>
                          </div>
                        <!-- 模态窗口  结束!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

<script>
    $(function () {
        $("#button").click(function () {
            var package_id = '<?= \Yii::$app->request->get("package_id",1); ?>';
            var reasonText = $('#reason').val();
            $.post('/package-apply/judge-package',{'package_id':package_id,'reasonText':reasonText},function (res) {
                res = JSON.parse( res );
                if (res.code == 200){
                    layer.msg("申请成功")
                    window.location.reload();
                }else{
                    layer.msg("申请失败")
                }
            })

        })
    })
    </script>
